//
//  HLWayTableViewController.m
//  NewKY
//
//  Created by 罗浩林 on 16/11/15.
//  Copyright © 2016年 Dee. All rights reserved.
//

#import "HLWayTableViewController.h"

@interface HLWayTableViewController ()

@property (nonatomic,strong) NSArray *dataArr;

@end

@implementation HLWayTableViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.dataArr = @[@"手术治疗",@"保守治疗",@"药物治疗"];
    
    NSLog(@"%@",self.dataArr);
    
    [self.tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:@"wayCellID"];
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

#pragma mark - Table view data source

//- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
//
//    return 0;
//}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {

    return self.dataArr.count;
}


- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"wayCellID" forIndexPath:indexPath];
    
    cell.textLabel.text = self.dataArr[indexPath.item];
    
    return cell;
}


-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    
    [self.navigationController popViewControllerAnimated:YES];
    
    UITableViewCell * cell =  [tableView cellForRowAtIndexPath:indexPath];
    
    if (self.datablock) {
        self.datablock(cell.textLabel.text);
    }
    
}


@end
